package com.example.educational.service;

import com.example.educational.entity.NoticeReceived;
import com.example.educational.entity.User;
import com.example.educational.entity.VerCode.AesException;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public interface CorporateService {


    /**
     * @param index 配置再yml中的应用序号
     * @return 此应用成功获取到的token
     */
    String getToken4InnerApp(int index);


    /**
     * @return 本企业通讯录成功获取到的token
     */
    String getToken4AddrBook();

    /**
     * @param noticeReceived 消息
     * @return 推送是否成功
     */
    Boolean pushNotice2Everyone(NoticeReceived noticeReceived);


    Boolean pushNotice2User(NoticeReceived noticeReceived, ArrayList<String> userIdList);


    /**
     * @return 所有用户的信息
     */
    ArrayList<User> getUserList();

    /**
     * @param code 用户静态鉴权的code
     * @return 用户信息
     */
    User getUserDetail(String code);


    /**
     * @param sVerifyMsgSig
     * @param sVerifyTimeStamp
     * @param sVerifyNonce
     * @param sVerifyEchoStr
     * @return
     * @throws AesException
     */
    String verifyURL(String sVerifyMsgSig, String sVerifyTimeStamp, String sVerifyNonce, String sVerifyEchoStr) throws AesException;

    /**
     * @param sReqMsgSig
     * @param sReqTimeStamp
     * @param sReqNonce
     * @param sReqData
     * @return
     * @throws AesException
     */
    String reqMsgURL(String sReqMsgSig, String sReqTimeStamp, String sReqNonce, String sReqData) throws AesException;

    /**
     * @param code 企业微信回传的一次性验证码
     * @return 用户信息
     */
    User checkUserIdentify(String code);


}